With development of communications technologies, communications networks have increasingly high requirements on time synchronization. Existing communications networks' requirements on time synchronization have reached a sub-microsecond level. In the future, large-scale coordinated communication may be applied, and therefore, coordinated communication among multiple cells, multiple antennas, and the like may require time synchronization of a nanosecond level or even a sub-nanosecond level. The IEEE 1588 V2 time synchronization protocol (Precision Time Protocol, PTP for short) implements time synchronization of an entire network by exchanging PTP data packets including a timestamp between communications network nodes, which is a relatively precise time synchronization solution at present.
In the prior art, after receiving a PTP data packet, a communications network node identifies the PTP data packet between a physical layer (Physical, PHY for short) and a media access control (Medium Access Control, MAC for short) layer, and adds a timestamp to the PTP data packet. In a process of adding the timestamp, delay compensation is performed based on a delay of PTP data packet identification. However, the timestamp obtained by using this method has low precision, resulting in low precision of time synchronization of the entire communications network.